#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=3e5+1000;
typedef long long LL;
LL a[maxn],b[maxn];
LL sum[maxn];
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  LL n;cin>>n;
  sum[n+1]=0;
  for(LL i=1;i<=n;i++){
    cin>>a[i];
  }
  sort(a+1,a+1+n);
  for(LL i=1;i<=n;i++){
    b[i]=n-i+1;
  }
  for(LL i=n;i>=1;i--){
    sum[i]=max(sum[i+1],b[i]+a[i]);
  }
  LL ans=1;
  for(LL i=1;i<=n-1;i++){
    if(a[i]+n>=sum[i+1]){
        ans++;
    }
  }
  cout<<ans<<endl;
return 0;
}
